﻿using EmbeddedSharp.Core;
using EmbeddedSharp.Scripting;

namespace Zove.Scripting.Core
{
    /// <summary>
    /// Unary function factory
    /// </summary>
    public class ZoveScriptingUnaryFunctionFactory :
        DefaultUnaryFunctionFactory
    {
        public ZoveScriptingUnaryFunctionFactory(IContext context)
            : base(context)
        {
        }

        public override UnaryFunctionTranslator CreateTranslator(string subject)
        {
            var translator = new ZoveScriptingUnaryFunctionTranslator(
                Context.GetFunctionManager(), subject);
            translator.Context = Context as IZoveScriptingContext;

            return translator;
        }
    }
}